# Copyright (C) 2022-2024 Inspur Corp. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
FROM golang:1.19-alpine3.16

RUN echo "http://mirrors.aliyun.com/alpine/v3.12/main/" > /etc/apk/repositories && \
    echo "http://mirrors.aliyun.com/alpine/v3.12/community/" >> /etc/apk/repositories
RUN apk update
RUN apk add --no-cache nghttp2 zlib binutils  binutils-gold \
    apk-tools libretls busybox ncurses git libcurl libtool expat  \
    gmp pcre2 make musl-dev \
    openssl libssl1.1 libcrypto1.1 tzdata bash gcc

RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
WORKDIR /opt/gopath/src

ADD ./did-service /etc/did-service/did-service
ADD ./config      /etc/did-service/config

RUN mkdir /etc/did-service/repo

WORKDIR /etc/did-service/

CMD ["./did-service"]